#pragma once

#include <vector>
#include <string>

#include "RelationshipType.h"
#include "RelationshipArgumentType.h"
#include "ConstraintEntry.h"
#include "ConstraintTableType.h"


/*!
 ConstraintTable is used by the QueryPreprocessor
 to store the with clause information
 in the following format (inside ConstraintEntry data structure)
 RelationshipType - Argument 1 - Argument 2 - Argument Type 1 - Argument Type 2 - Argument Attr 1 - Argument Attr 2
 ConstraintTable will then be used by QueryEvaluator for 
*/
class ConstraintTable {
	private:
		std::vector<ConstraintEntry> mConstraintEntries;
	public:
		ConstraintTable(void);
		~ConstraintTable(void);

		///Adds a ConstraintEntry into the table, returning true if successful (if all inputs (except the attributes)  are non-null and non-empty).
		bool addConstraintEntry(ConstraintType constraintType, 
			std::string constraintArg1, RelationshipArgumentType relationshipArgType1, ConstraintAttrType attr1, 
			std::string constraintArg2, RelationshipArgumentType relationshipArgType2, ConstraintAttrType attr2 );
		/// Returns the ConstraintEntry at the specifed index. Returns an empty ConstraintEntry if index is out of bounds.
		ConstraintEntry getConstraintEntry(int index);
		/// Gets the number of entries currently in the table. 
		int getNumberOfEntries();

		bool replaceSynonym(std::string s1, std::string s2);

		bool removeEntryAtIndex(int index);
};

